import request from '@/utils/request'

// api地址
const api = {
  list: 'pet/list',
  detail: 'pet/detail',
  add: 'pet/add',
  edit: 'pet/edit',
  remove: 'pet/remove'
}

// 收货地址列表
export const list = (param) => {
  return request.get(api.list, param)
}

// 收货地址详情
export const detail = (petId) => {
  return request.get(api.detail, { petId })
}

// 新增收货地址
export const add = (data) => {
  return request.post(api.add, { form: data })
}

// 编辑收货地址
export const edit = (petId, data) => {
  return request.post(api.edit, { petId, form: data })
}

// 删除收货地址
export const remove = (petId) => {
  return request.post(api.remove, { petId })
}
